package com.hp.jus.core;

import java.net.URL;
import java.util.Properties;

/**
 * 
 * @author salemmo
 * this interface will act as the contract between JUS and the data store
 */
public interface IJUS {
	/**
	 * this will add new shortened URL to the data store
	 * @param url the url to be added
	 * @param key the bounded key with the url
	 * @return a boolean with adding results
	 */
	public Boolean add(String key,URL url)throws Exception;
	/**
	 * this will remove shortened URL from the data store
	 * @param key the bounded key with the url
	 * @return a boolean with removing results
	 */
	public Boolean remove(String key)throws Exception;
	/**
	 * this will update shortened URL in the data store
	 * @param key the bounded key with the url
	 * @param url the url to be added
	 * @return a boolean with removing results
	 */
	public Boolean update(String key, URL url)throws Exception;
	/**
	 * this will get full URL from the data store
	 * @param key the bounded key with the url
	 * @return a URL object with the original URL
	 */
	public URL get(String key)throws Exception;
	/**
	 * this will set the props needed for the imple to do his job
	 * @param props
	 */
	public void setProperties(Properties props);
	/**
	 * intialization of the implementation class
	 */
	public void init()throws Exception;
	/**
	 * release resources and save on exit
	 */
	public void close()throws Exception;
}
